using System;
using System.Linq;
using System.Windows;
using MultiTCPProxy.Services;

namespace MultiTCPProxy
{
    public class Program
    {
        [STAThread]
        public static void Main(string[] args)
        {
            // 检查是否以服务模式运行
            if (args.Length > 0 && (args.Contains("install") || args.Contains("uninstall") || args.Contains("start") || args.Contains("stop")))
            {
                // 以服务模式运行
                WindowsServiceManager.ProxyServiceHost.ConfigureService();
                return;
            }

            // 以GUI模式运行
            var application = new Application();
            application.StartupUri = new Uri("MainWindow.xaml", UriKind.Relative);
            application.Run();
        }
    }
}